Skip to content

docs(cf11g): restore ecosystem context graph prerequisite - #20

Merged
TheHalfMoon merged 5 commits into
mainfrom
docs/cf11g-context-graph-planning
Aug 26, 2026
Merged

docs(cf11g): restore ecosystem context graph prerequisite#20
TheHalfMoon merged 5 commits into
mainfrom
docs/cf11g-context-graph-planning

Conversation

@TheHalfMoon

@TheHalfMoon TheHalfMoon commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Reconcile the canonical commandF roadmap after historical CF-11 was used for the multi-version package-graph foundation correction.

This PR preserves completed CF-11 history and introduces CF-11G as the missing ecosystem Context Graph slice required before CF-12 commandf impact.

Decision

CF-11  = canonical multi-version package graph foundation correction (history unchanged)
CF-11G = ecosystem Context Graph + commandf context
CF-12  = commandf impact, depends on CF-11G

Spec Kit sequence 012 is the next available planning-package number only; it does not renumber downstream product slices.

Scope

Documentation / planning only:

  • reconcile docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md;
  • add specs/012-cf-11g-ecosystem-context-graph/spec.md;
  • add plan.md;
  • add dependency-ordered tasks.md;
  • add explicit consistency analysis.

Key implementation contract planned

CF-11G will ship:

commandf context --lock commandf.lock --cache .commandf/cache --format json

The plan requires:

  • lock schema v2 with exact resolver-recorded parent→child package edges;
  • backward read compatibility for existing schema-v1 locks;
  • fail-closed Context Graph refusal on v1 instead of reconstructing ambiguous edges;
  • deterministic package/artifact/reference relations;
  • explicit resolved / external / ambiguous canonical target states;
  • bounded StructureDefinition, ValueSet, and CodeSystem V1 reference extractors;
  • explicit unsupported-resource coverage metadata;
  • offline verified-cache graph construction;
  • no graph database, vector search, AI authority, CF-06 pin change, or CF-10 corpus mutation.

Roadmap independence

The external HL7 maintainer/upstream path is not a dependency of this planning or implementation slice. CF-06 production semantics remain unchanged.

Verification boundary

This PR contains no Rust, Cargo, fixture, workflow, lockfile, or runtime behavior changes.

Implementation starts only from the Spec/Plan/Tasks contract after exact-head planning review and will follow the task order in stacked independently reviewable PRs.

Closes #19 when this roadmap/spec reconciliation becomes canonical.


Summary by cubic

Restores the missing Context Graph prerequisite by introducing CF-11G and updating the Master Architecture so CF-12 commandf impact depends on it. Historical CF-11 remains the multi-version package-graph foundation; this PR is planning-only and changes no runtime behavior.

  • Updates docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md to add CF-11G and adjust downstream dependencies (CF-12, CF-16).
  • Adds specs/012-cf-11g-ecosystem-context-graph/{spec.md,plan.md,tasks.md,consistency.md}.
  • Defines commandf context JSON output and a lock schema v2 requirement with backward read-compatibility for schema v1.
  • Documents offline, cache-verified graph construction and explicit resolved/external/ambiguous target states.
  • No Rust/Cargo, fixtures, workflows, lockfiles, or runtime behavior changes in this PR.

Written for commit 190945b. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation
    • Added the CF-11G roadmap entry and clarified sequencing relationships with related initiatives.
    • Documented the planned Ecosystem Context Graph, including package and artifact relationships, dependency provenance, deterministic output, and offline operation.
    • Defined the planned commandf context command, supported FHIR canonical-reference extraction, cache verification, bounded inputs, and fail-closed behavior for incomplete lock data.
    • Added implementation tasks, testing requirements, regression gates, acceptance criteria, and migration guidance.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f15a1726-3a06-4825-81ac-7b2e7e579d97

📥 Commits

Reviewing files that changed from the base of the PR and between 5bafce4 and 190945b.

📒 Files selected for processing (5)
  • docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md
  • specs/012-cf-11g-ecosystem-context-graph/consistency.md
  • specs/012-cf-11g-ecosystem-context-graph/plan.md
  • specs/012-cf-11g-ecosystem-context-graph/spec.md
  • specs/012-cf-11g-ecosystem-context-graph/tasks.md

📝 Walkthrough

Walkthrough

This change reconciles the roadmap identifiers and adds the CF-11G specification package. It defines the Context Graph contract, lock schema v2, deterministic offline processing, CLI behavior, implementation tasks, validation gates, and sequencing before CF-12.

Changes

CF-11G Ecosystem Context Graph

Layer / File(s) Summary
Roadmap identity and consistency
docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md, specs/012-cf-11g-ecosystem-context-graph/consistency.md
Defines CF-11G as the ecosystem Context Graph slice. Preserves completed CF-11 history and updates CF-12 and CF-16 dependencies.
Context Graph specification
specs/012-cf-11g-ecosystem-context-graph/spec.md
Defines package and artifact nodes, dependency edges, FHIR canonical-reference extraction, target states, provenance, offline validation, acceptance criteria, and non-goals.
Graph and CLI implementation plan
specs/012-cf-11g-ecosystem-context-graph/plan.md
Plans lock schema v2, resolver evidence, bounded extraction, deterministic graph construction, canonical resolution, trust boundaries, and the local commandf context CLI.
Validation and delivery gates
specs/012-cf-11g-ecosystem-context-graph/tasks.md, specs/012-cf-11g-ecosystem-context-graph/plan.md
Defines implementation stacks, fixtures, determinism checks, regression gates, review requirements, migration handling, and sequencing constraints before CF-12.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/cf11g-context-graph-planning

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

External source review — CF-11G / CF-12 relevance

Reviewed the newly supplied sources as design evidence only. No donor code is admitted by this note.

Accepted immediate design influence

  • Graphify (Graphify-Labs/graphify, Apache-2.0): strong support for preserving the distinction between directly extracted graph evidence and derived resolution. CF-11G should make this distinction explicit in graph output rather than collapsing provenance into a single edge type. Its local-first, deterministic, non-vector graph approach is directionally aligned with CF-11G.
  • Code-Graph-RAG (vitali87/code-graph-rag, MIT): useful provenance/verification precedent, especially canonical index + provenance manifest + verify patterns. Relevant to deterministic graph export/verification and later CF-12 impact traversal, but Memgraph, vector/RAG, and AI query generation are not required for commandF V1.
  • InterSystems FHIR / IRIS for Health: confirms real-world importance of package/profile handling, multiple FHIR versions, FHIR façades/adapters, and graph-like reference relationships across healthcare systems. Treat as product/interoperability evidence, not source code authority.

Accepted future hardening influence, not CF-11G scope

  • Google DeepMind — Verifiable Data Audit: append-only, tamper-evident, independently verifiable audit evidence is relevant to a future commandF provenance/audit layer. It is not a reason to add blockchain, Merkle infrastructure, or runtime logging to CF-11G now.
  • OpenSandbox (opensandbox-group/OpenSandbox, Apache-2.0): strong reference for digest-pinned execution artifacts, signed provenance, explicit egress policy, credential isolation, and strong sandbox boundaries. Relevant only if commandF later executes untrusted external tooling or agent workflows; current deterministic offline CF-11G needs no sandbox runtime dependency.
  • DeepSeek Harness (deepseek-ai/deepseek-harness, MIT): useful principles include durable event provenance and replaceable capability seams. A general plugin framework is deliberately rejected for current commandF scope because the existing Rust CLI/library architecture does not require it.

Not relevant to the current roadmap

  • TimesFM (google-research/timesfm, Apache-2.0): a time-series forecasting foundation model. No justified dependency or architectural role exists in CF-11G or CF-12. Keep out of the implementation.

Resulting CF-11G/CF-12 constraints

  1. Preserve exact source evidence separately from derived resolution status.
  2. Keep graph generation local/offline/deterministic and dependency-light.
  3. Add deterministic graph verification/export evidence before CF-12 consumes it.
  4. Do not add Memgraph, vector stores, RAG, LLM authority, plugin frameworks, sandbox runtimes, or forecasting models to V1.
  5. Keep a future audit/provenance extension possible without making it a prerequisite for CF-12.

This review does not change CF-06 semantics, HL7 pins, the frozen CF-10 corpus, or the existing CF-11G -> CF-12 dependency order.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Action performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TheHalfMoon
TheHalfMoon marked this pull request as ready for review August 26, 2026 03:48
@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@TheHalfMoon
TheHalfMoon merged commit ffbcdae into main Aug 26, 2026
5 of 6 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Restore CF-11G Context Graph prerequisite for commandf impact

📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Restores CF-11G as the Context Graph prerequisite without rewriting completed CF-11 history.
• Defines deterministic, offline graph behavior and lock schema v2 migration boundaries.
• Orders implementation, verification, and convergence work before CF-12 can begin.
Diagram

graph TD
  Roadmap["Product roadmap"] --> CF11["CF-11 foundation"] --> LockV2["Lock schema v2"] --> Graph["Context Graph"] --> CLI["commandf context"] --> CF12["CF-12 impact"]
  CF02["CF-02 inspection"] --> Graph
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Renumber downstream slices
  • ➕ Restores a strictly numeric roadmap sequence.
  • ➕ Avoids a suffixed CF-11G identity.
  • ➖ Invalidates established CF-12 through CF-16 references.
  • ➖ Creates broad documentation and historical churn without product benefit.
2. Rewrite completed CF-11 history
  • ➕ Reclaims CF-11 for its originally planned Context Graph meaning.
  • ➕ Keeps CF-12 directly dependent on numeric CF-11.
  • ➖ Misrepresents merged multi-version foundation work.
  • ➖ Breaks immutable references to commits, specifications, evidence, and PRs.

Recommendation: Keep the PR's CF-11G gap-restoration approach. It preserves canonical history and downstream identifiers while making the missing prerequisite explicit; renumbering or rewriting history would create substantially more ambiguity and migration cost.

Files changed (5) +942 / -3

Documentation (5) +942 / -3
COMMAND_F_MASTER_ARCHITECTURE_V2.mdReconcile CF-11G roadmap identity and dependencies +18/-3

Reconcile CF-11G roadmap identity and dependencies

• Explains why completed CF-11 retains its multi-version foundation identity and introduces CF-11G for the missing Context Graph slice. Updates CF-12 and CF-16 to depend on CF-11G.

docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md

consistency.mdRecord CF-11G planning consistency closure +211/-0

Record CF-11G planning consistency closure

• Documents consistency checks for roadmap identity, determinism, lock compatibility, extraction scope, trust boundaries, and downstream sequencing. Marks planning consistency as passed while keeping CF-12 ineligible until implementation convergence.

specs/012-cf-11g-ecosystem-context-graph/consistency.md

plan.mdDefine the Context Graph implementation strategy +329/-0

Define the Context Graph implementation strategy

• Plans lock schema v2, resolver edge capture, deterministic graph modeling, bounded FHIR reference extraction, canonical target matching, and the offline CLI. Defines testing, migration, review, and independently reviewable implementation stacks.

specs/012-cf-11g-ecosystem-context-graph/plan.md

spec.mdSpecify CF-11G behavior and acceptance criteria +229/-0

Specify CF-11G behavior and acceptance criteria

• Defines normative behavior for exact package and artifact provenance, canonical references, explicit resolution states, deterministic output, and cache-only construction. Establishes acceptance proofs and explicit non-goals for the first graph slice.

specs/012-cf-11g-ecosystem-context-graph/spec.md

tasks.mdOrder CF-11G implementation and verification tasks +155/-0

Order CF-11G implementation and verification tasks

• Breaks delivery into lock-v2 evidence, Context Graph library, CLI, regression, review, and convergence stacks. Enforces dependency ordering and blocks CF-12 implementation until CF-11G convergence closes.

specs/012-cf-11g-ecosystem-context-graph/tasks.md

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Source URLs break determinism 🐞 Bug ≡ Correctness
Description
The new acceptance criterion requires byte-identical lock-v2 output for equivalent resolver
permutations, but the resolver serializes the actual acquisition URL in LockedPackage.source,
which can differ when identical bytes come from the primary endpoint versus the secondary
redirect/fallback. Because the plan also requires preserving source provenance without defining a
canonical source identity or semantic comparison, the mandated byte-equality proof remains flaky.
Code

specs/012-cf-11g-ecosystem-context-graph/spec.md[198]

+Equivalent resolver root-order permutations and repeated `context` builds over identical bytes MUST produce byte-identical lock v2 and Context Graph JSON respectively.
Relevance

●●● Strong

Accepted determinism precedent covers provenance differing by acquisition endpoint; canonicalizing
source identity is needed for byte equality.

PR-#12

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The current lock schema serializes source directly, the resolver copies the selected archive URL
into that field, and registry acquisition can return different endpoint/redirect URLs for the same
package bytes. This is the same byte-comparison failure pattern already accepted in PR #13.

crates/commandf-pkg/src/lock.rs[14-20]
crates/commandf-pkg/src/lock.rs[41-44]
crates/commandf-pkg/src/resolver.rs[41-50]
crates/commandf-pkg/src/registry.rs[42-44]
crates/commandf-pkg/src/registry.rs[94-102]
crates/commandf-pkg/src/registry.rs[126-140]
PR-#13

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Lock-v2 byte determinism cannot be guaranteed while `LockedPackage.source` stores a transport-specific URL that may vary across equivalent acquisitions.

## Issue Context
The planning contract must either require a canonical stable source identifier in serialized locks or define determinism evidence as a semantic comparison that normalizes/excludes transport URLs while retaining provenance appropriately.

## Fix Focus Areas
- specs/012-cf-11g-ecosystem-context-graph/spec.md[196-198]
- specs/012-cf-11g-ecosystem-context-graph/plan.md[208-217]
- specs/012-cf-11g-ecosystem-context-graph/tasks.md[39-45]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Sibling roadmap remains stale 🐞 Bug ⚙ Maintainability
Description
The reconciliation reassigns CF-11 to the multi-version foundation and creates CF-11G for the
Context Graph, but COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md still says its execution stack is
unchanged and lists CF-11 as the Context Graph immediately before CF-12. This leaves the
authoritative plan set with conflicting slice identities and sequencing despite consistency.md
declaring the roadmap contradiction closed.
Code

docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[R124-126]

+Canonical execution used `CF-11` for the multi-version package-graph foundation correction required to represent real transitive FHIR package closures. That completed history is retained exactly and is not renamed.
+
+The ecosystem Context Graph originally planned under numeric CF-11 still remains a required prerequisite for `CF-12 commandf impact`. To restore that missing product capability without rewriting history or shifting every downstream identifier, the graph-gap restoration slice is named:
Relevance

●●● Strong

Roadmap contradiction is directly in an authoritative sibling document; reconciliation explicitly
requires updating all plan-set identities.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The plan index retains both documents in the authoritative plan set; the discovery document
explicitly claims not to reorder the execution stack but still assigns the ecosystem Context Graph
to CF-11, contradicting the newly added CF-11G identity.

docs/COMMAND_F_PLAN_INDEX.md[3-19]
docs/COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md[642-659]
docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[124-134]
docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[150-152]
specs/012-cf-11g-ecosystem-context-graph/consistency.md[31-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new CF-11/CF-11G identity mapping conflicts with the retained execution list in the discovery-coverage authority.

## Issue Context
Update the sibling roadmap to preserve historical CF-11 while inserting CF-11G before CF-12, or explicitly replace its numbered list with a pointer to the canonical Master Architecture stack.

## Fix Focus Areas
- docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[122-134]
- docs/COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md[642-663]
- specs/012-cf-11g-ecosystem-context-graph/consistency.md[18-43]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 13 rules
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo


### J. Determinism

Equivalent resolver root-order permutations and repeated `context` builds over identical bytes MUST produce byte-identical lock v2 and Context Graph JSON respectively.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Source urls break determinism 🐞 Bug ≡ Correctness

The new acceptance criterion requires byte-identical lock-v2 output for equivalent resolver
permutations, but the resolver serializes the actual acquisition URL in LockedPackage.source,
which can differ when identical bytes come from the primary endpoint versus the secondary
redirect/fallback. Because the plan also requires preserving source provenance without defining a
canonical source identity or semantic comparison, the mandated byte-equality proof remains flaky.
Agent Prompt
## Issue description
Lock-v2 byte determinism cannot be guaranteed while `LockedPackage.source` stores a transport-specific URL that may vary across equivalent acquisitions.

## Issue Context
The planning contract must either require a canonical stable source identifier in serialized locks or define determinism evidence as a semantic comparison that normalizes/excludes transport URLs while retaining provenance appropriately.

## Fix Focus Areas
- specs/012-cf-11g-ecosystem-context-graph/spec.md[196-198]
- specs/012-cf-11g-ecosystem-context-graph/plan.md[208-217]
- specs/012-cf-11g-ecosystem-context-graph/tasks.md[39-45]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +124 to +126
Canonical execution used `CF-11` for the multi-version package-graph foundation correction required to represent real transitive FHIR package closures. That completed history is retained exactly and is not renamed.

The ecosystem Context Graph originally planned under numeric CF-11 still remains a required prerequisite for `CF-12 commandf impact`. To restore that missing product capability without rewriting history or shifting every downstream identifier, the graph-gap restoration slice is named:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. Sibling roadmap remains stale 🐞 Bug ⚙ Maintainability

The reconciliation reassigns CF-11 to the multi-version foundation and creates CF-11G for the
Context Graph, but COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md still says its execution stack is
unchanged and lists CF-11 as the Context Graph immediately before CF-12. This leaves the
authoritative plan set with conflicting slice identities and sequencing despite consistency.md
declaring the roadmap contradiction closed.
Agent Prompt
## Issue description
The new CF-11/CF-11G identity mapping conflicts with the retained execution list in the discovery-coverage authority.

## Issue Context
Update the sibling roadmap to preserve historical CF-11 while inserting CF-11G before CF-12, or explicitly replace its numbered list with a pointer to the canonical Master Architecture stack.

## Fix Focus Areas
- docs/COMMAND_F_MASTER_ARCHITECTURE_V2.md[122-134]
- docs/COMMAND_F_DISCOVERY_COVERAGE_2026-08-13.md[642-663]
- specs/012-cf-11g-ecosystem-context-graph/consistency.md[18-43]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roadmap: restore context-graph prerequisite before commandf impact

1 participant